package com.dson.common;

import lombok.Data;

@Data
public class LagouResponse {

    private boolean success;
    private String errMsg;
    private String data;

    public static LagouResponse success(String data) {
        return of(true, null, data);
    }

    public static LagouResponse failure(String errMsg){
        return of(false,errMsg,null);
    }

    private static LagouResponse of(boolean status, String errorMsg, String data) {
        LagouResponse lagouResponse = new LagouResponse();
        lagouResponse.success = status;
        lagouResponse.errMsg = errorMsg;
        lagouResponse.data = data;
        return lagouResponse;
    }
}
